<?php 
if(!defined('ADMIN')){
	exit('Access Denied');
}
?>
<form id="pagerForm" method="post" action="<?=u("content",'addrealte',array('q'=>$q,'gid'=>$gid))?>">
    <input type="hidden" name="v" value="<?=$v?>" id="listids" />
	<input type="hidden" name="pageNum" value="<?=$page?>" />
	<input type="hidden" name="numPerPage" value="<?=$pagesize?>" />
	<input type="hidden" name="orderField" value="<?=$orderField?>" />
	<input type="hidden" name="orderDirection" value="<?=$orderDirection?>" />
</form>
<div class="pageHeader">
	<form rel="pagerForm" onsubmit="return dwzSearch(this, 'dialog');" action="<?=u("content",'addrealte',array('q'=>$q,'gid'=>$gid))?>" method="post">
	<div class="searchBar">
		<ul class="searchContent">
			<li style="width: 500px;">
				<label>产品名称：</label>
				<input type="text" name="q" value="<?=$q?>" />
                <select name="catid">
                <option value="">选择产品类别</option>
                <?
                while(list($k,$v)=each($catlistrow)){
                    if($v["id"]==$catid){
                        $chk="selected='true'";
                    }else{
                       $chk=""; 
                    }
               ?>
               <option value="<?=$v["id"]?>" <?=$chk?>><?=$v["catname"]?></option>
               <?     
                }
                ?>
                </select>
                <button type="submit">查询</button>
			</li>
		</ul>

	</div>
	</form>
</div>
<div class="pageContent">
<form action="index.php?mod=content&act=addrealte&gid=<?=$gid?>" method="post"  class="pageForm required-validate"  name="form1" onsubmit="return validateCallback(this, dialogAjaxDone);">
<input type="hidden" name="gid" value="<?=$gid?>" />
<input type="hidden" name="sub" value="save" />
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="25" class="center"><input type="checkbox" class="checkboxCtrl" group="orgId[]" /></th>
                <th>产品名称</th>
				<th width="150">类别</th>
			</tr>
		</thead>
        <tbody>
        <?php foreach ($row as $r){?>
		<tr target="id" rel="<?=$r["id"]?>">
				<td class="center"><input type="checkbox" id="orgId" name="orgId[]" value="<?=$r["id"]?>" <?
                 //if(in_array($r["id"],$selectlist)){
                  //  echo 'checked="true"';
                // }
                ?> /></td>
				<td class="left"><?=$r["title"]?></td>
				<td class="center"><?=$r["catname"]?></td>
		</tr>
        <?php }?>   
		</tbody>
	</table>            
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select name="numPerPage" class="combox" onchange="dwzPageBreak({targetType:'dialog', numPerPage:this.value})">
				<option value="20" <? if($pagesize==20){ echo 'selected="true"';}?>>20</option>
				<option value="50" <? if($pagesize==50){ echo 'selected="true"';}?>>50</option>
				<option value="100" <? if($pagesize==100){ echo 'selected="true"';}?>>100</option>
				<option value="200" <? if($pagesize==200){ echo 'selected="true"';}?>>200</option>
			</select>
			<span>条，共<?php echo $total;?>条</span>
		</div>
		
		<div class="pagination" targetType="dialog" totalCount="<?php echo $total;?>" numPerPage="<?=$pagesize?>"  pageNumShown="10" currentPage="<?=$page?>"></div>

	</div>
		<div class="formBar">
			<ul>
                <li>选择关联类别：
                <select name="goods_relate" style="width: 150px;height: 25px;">
                <?
                while(list($k,$v)=each($goods_relate_list)){
                ?>
               <option value="<?=$k?>"><?=$v?></option>
               <?     
                }
                ?>
                </select>                
            </li>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>  
        </form>  
</div>    
